using System;
using System.Collections.Generic;
using System.Text;
using Decav.Gatsb.Locales;

namespace Decav.Gatsb
{
    /// <summary>
    /// Gets the locale that is used when another locale is not available.
    /// </summary>
    public sealed class NeutralLocale : Locale
    {
        public NeutralLocale()
            : base("Unknown", Guid.Empty)
        {
        }

        /// <summary>
        /// Formats the name of a <see cref="Location"/> into the name for the current
        /// locale.
        /// </summary>
        /// <param name="location">The location to format the name for.</param>
        /// <param name="format">The method that should be used to format the location name.</param>
        /// <returns>The name of the location, formatted to the locale.</returns>
        public override string FormatLocationName(Location location, LocationNameFormat format)
        {
            if (location == null)
                throw new ArgumentNullException("location");

            return location.Name;
        }

        public override LocationSearchCriteria ParseSearchString(string searchString)
        {
            return NewYorkCityLocale.ParseSearch(searchString);
        }
    }
}
